<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>原型对象创建方法案例</title>
</head>
<body>
    <div id="result"></div>

    <script>
        function Clothes0() {}

        
        Clothes0.prototype.type = "衣服";
        Clothes0.prototype.Clothes_fun = function(owner) {
            
            return this.type + "是" + owner + "穿的衣服";
        };

        var xiaoMeiClothes = new Clothes0();
        var xiaoLiClothes = new Clothes0();
        xiaoMeiClothes.type = "黄色的吊带裙";
        xiaoLiClothes.type = "黑色的连衣裙";
        document.getElementById("result").innerHTML = 
            xiaoLiClothes.Clothes_fun("小丽") + "<br>" +   
            xiaoMeiClothes.Clothes_fun("小美") + "<br>" +  
            "小美穿的衣服是" + xiaoMeiClothes.type;       
    </script>
    
</body>
</html>